<?php
defined('_JEXEC') or die;
$baseurl = JURI::base();

if($headerText)
	echo $headerText;
?>
<style type="text/css">
	.moduletable img{
		display: block;margin: 0 auto; width:100%;
	}
</style>
<?php
foreach($list as $item):
	$link = JRoute::_('index.php?option=com_banners&task=click&id='. $item->id);
	$imageurl = $item->params->get('imageurl');
	$width = $item->params->get('width');
	$height = $item->params->get('height');
	$alt = $item->params->get('alt');
	$alt = $alt ? : $item->name ;
	$alt = $alt ? : JText::_('MOD_BANNERS_BANNER') ;
	if($item->clickurl):
		$target = $params->get('target', 1);
?>
<a
							href="<?php echo $link; ?>"
							title="<?php echo htmlspecialchars($item->name, ENT_QUOTES, 'UTF-8');?>">
			<img
					src="<?php echo $baseurl , $imageurl?>"
					alt="<?php echo $alt?>"
					<?php if (!empty($width)) echo 'width ="',$width,'"'?>
					<?php if (!empty($height)) echo 'height ="',$height,'"'?>
			/>
</a>
<?php else://end clickurl?>
			<img
				src="<?php echo $baseurl , $imageurl?>"
				alt="<?php echo $alt?>"
				<?php if (!empty($width)) echo 'width ="',$width,'"'?>
				<?php if (!empty($height)) echo 'height ="',$height,'"'?>
			/>
<?php endif;
endforeach?>
<?php if($footerText)
	echo $footerText;
?>